package com.esisa.dao.hibernate;

import com.esisa.dao.VaccinationCatalogueDao;
import com.esisa.models.VaccinationCatalogue;

public class VaccinationCatalogueDaoHibernate  extends AbstractHibernateDao implements VaccinationCatalogueDao {

	@Override
	public boolean insert(VaccinationCatalogue vaccinationCatalogue) {
		beginTransaction();
		   session.save(vaccinationCatalogue);
		commit();
		return true;
	}

	@Override
	public VaccinationCatalogue select(Long id) {
		VaccinationCatalogue vaccinationCatalogue=null;
		beginTransaction();
			vaccinationCatalogue=(VaccinationCatalogue)session.get(VaccinationCatalogue.class,id);
		commit();
		return vaccinationCatalogue;
	}

	@Override
	public void delete(VaccinationCatalogue vaccinationCatalogue) {
		beginTransaction();
			session.delete(vaccinationCatalogue);
		commit();
	}

	@Override
	public void update(VaccinationCatalogue vaccinationCatalogue) {
		beginTransaction();
			session.update(vaccinationCatalogue);
		commit();
	}
	
}
